<?php
$conn = new pdo('mysql:host=127.0.0.1;port=3306;dbname=zgdb;charset=utf8', 'root', '', [19 => 2, 1002 => 'set names utf8']);

//数据修改
//exec
$sql = "update t_user set account='hh' where id = 111";
echo $conn->exec($sql); //1 修改完成 0 没有修改

//prepare
$s = "update t_user set score=score+:score";
$pst = $conn->prepare($s);
echo $pst->execute(['score' => 1]);
